3386ee5c199232d4984b71810d6f240679fb68f0,rxjava-v1/src/main/java/io/apptik/rxhub/AbstractRxJava1Hub.java,AbstractRxJava1Hub,emit,#Object#Object#,172

Before Change


            throw new IllegalStateException(String.format(Locale.ENGLISH,
                    "Emitting events on Tag(%s) not allowed.", tag));
        }
        if (getProxyType(tag) == RxJava1ProxyType.ObservableRefProxy) {
            throw new IllegalStateException(String.format(Locale.ENGLISH,
                    "Emitting event not possible. Tag(%s) represents immutable stream.", tag));
        }

After Change


            throw new IllegalStateException(String.format(Locale.ENGLISH,
                    "Emitting events on Tag(%s) not allowed.", tag));
        }
        RxJava1ProxyType proxyType = getProxyType(tag);
        if (proxyType == RxJava1ProxyType.ObservableRefProxy) {
            throw new IllegalStateException(String.format(Locale.ENGLISH,
                    "Emitting event not possible. Tag(%s) represents immutable stream.", tag));
        } else {
            Observable proxy = getProxyInternal(tag);
            if (proxyType == BehaviorRelayProxy ||
                    proxyType == PublishRelayProxy ||
                    proxyType == ReplayRelayProxy) {
                ((Action1) proxy).call(event);
            } else if (proxyType == BehaviorSubjectProxy ||
                    proxyType == PublishSubjectProxy ||
                    proxyType == ReplaySubjectProxy) {
                ((Observer) proxy).onNext(event);
            } else {
                //should not happen